package main

import "fmt"

type Animal struct {
	color   string
	age     uint16
	canMove bool
	int
}

func (animal *Animal) move() {
	fmt.Println("I am moving")
}

type Bird struct {
	Animal
	wing   bool
	canFly bool
}

func (bird *Bird) move() {
	fmt.Println("I am flying")
}

type Pet struct {
	Name   string
	color  string
	living bool
}
type Dog struct {
	Animal
	Pet
	isPet  bool
	mammal bool
}

func (dog *Dog) move() {
	fmt.Println("I am running")
}

type Cat struct {
	*Animal
	*Pet
}

func main() {
	var goldenRetriever Dog
	goldenRetriever.isPet = true
	goldenRetriever.mammal = true
	goldenRetriever.Animal.color = "golden"
	goldenRetriever.Animal.age = 2
	goldenRetriever.canMove = true
	goldenRetriever.int = 1111
	fmt.Println(goldenRetriever)
	goldenRetriever.move()
	/*
		cat := Cat{
			&Animal{color: "black", age: 12, canMove: true, int: 99},
			&Pet{Name: "cat", color: "white", living: true},
		}
	*/
	var cat Cat = Cat{}
	cat.Animal = &Animal{color: "black", age: 12, canMove: true, int: 99}
	cat.Pet = &Pet{Name: "cat", color: "white", living: true}
	(*cat.Animal).color = "xxx"
	fmt.Println(*cat.Animal)
	fmt.Println(*cat.Pet)
}
